/**
 * FileName: CellMain
 * Author:   powersi
 * Date:     2021/1/7 14:56
 * Description: cell
 */
package com.zm.demo.core.leetcode;

/**
 * Description: cell
 * Author:      powersi
 * Date:        2021/1/7 14:56
 */
public class CellMain {

    public static void main(String[] args) {
        System.out.println(f(1));
        System.out.println(f(2));
        System.out.println(f(3));
        System.out.println(f(4));
        System.out.println(f(5));
        System.out.println(f(6));
    }


    public static int f(int n){
        // 生命周期 3小时
        // 1 小时分裂一次
        // n 小时
        //        1
        //   1       1
        // 1   1   1   1
        //1 1 1 1 1 1 1 1

        if (n==0){
            return 1;
        }else {
            if (n < 3) {
                return 2*f(n-1);
            }else {
                return 2*f(n-1) - f(n-3);
            }
        }



    }
}
